package com.kevin.training.meal.service.impl;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import com.kevin.training.meal.dao.UserDao;
import com.kevin.training.meal.domain.User;
import com.kevin.training.meal.service.UserService;

@Named
public class UserServiceImpl implements UserService {

	@Inject
	private UserDao userDao;

	@Override
	public void register(User user) {
		userDao.create(user);
	}

	@Override
	public User getUserInfo(int id) {
		return userDao.get(id);
	}

	@Override
	public List<User> getAllIdAndNames() {
		return userDao.getAllIdAndNames();
	}

	@Override
	public void delete(int id) {
		userDao.delete(id);
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

}
